<template>
  <div class="flooPage">
    <div class="flooMain">

      <div class="flooMain_item" v-for="item in depList">
        <div class="flooMain_item_tit">{{ item.floorTxt }}</div>
        <div class="flooMain_item_children">
          <div class="flooMain_item_children_item" v-for="i in item.depts" @click="godetails(i)">{{ i.deptName }}
          </div>
        </div>
      </div>

    </div>
  </div>
</template>
<script>
import {getGroupDeptList} from "@/api/api";

export default {
  components: {},
  data() {
    return {
      openShow: null,
      depList: [],
      docters: []
    };
  },
  created() {
    this.GetHosDept();
  },
  methods: {
    // 获取科室列表 2维数组
    GetHosDept() {
      getGroupDeptList({
        "parentId": this.$route.query.parentId,
        "level": "1"
      }).then((res) => {
        if (res.code == 200) {
          this.depList = res.data;
        }
      });
    },
    // 跳转科室特色
    godetails(item) {
      if (!item.deptId) {
        alert(item.tips)
        return;
      }
      console.log(item)
      this.$router.push({
        path: "/department_details",
        query: {
          deptId: item.deptId,
          deptName: item.deptName

        },
      });
    },
    openFun(e) {
      if (e == this.openShow) {
        this.openShow = null;
      } else {
        this.openShow = e;
      }
    },
  },
};
</script>
<style scoped>
.flooPage {
  height: 100vh;
  overflow-y: scroll;
  background-color: #F2F5F8;

}

.dep_img {
  display: block;
  width: calc(100%);
  /* height: 144px; */
  /* padding: 1rem; */


}

.faq_page {
  /* padding-top: 19px; */
}

.faq_page_cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 2rem);
  padding: 0.8125rem 0;
  margin: 0 1rem;
  border-bottom: 1px solid #E7ECF5;
}

.faq_page_cell .left {
  display: flex;
  align-items: center;
}

.faq_page_cell .left img {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  object-fit: contain;
  margin-right: 0.625rem;
}

.faq_page_cell .right img {
  display: block;
  width: 8px;
  height: 13px;
  /* object-fit: contain; */
}

.open_box {
  width: calc(100% - 4.1875rem);
  padding: 0 17px 0 3.125rem;
  background-color: #f7fafd;
}

.open_box .dep_box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2.625rem;
}

.open_box .dep_box img {
  display: block;
  width: 0.5rem;
  height: 0.8125rem;
}

.flooMain {
  padding: 1rem;

}

.flooMain_item {
  display: flex;

}

.flooMain_item_tit {
  width: 3.125rem;
  font-size: 1.375rem;
  font-family: PingFang SC;
  font-weight: 500;
  color: #448EFF;
  /* line-height: 2.8125rem; */
  line-height: 2.375rem;
  color: #448EFF;

}

.flooMain_item_children {
  width: calc(100% - 3.125rem);
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  flex-wrap: wrap;
}

.flooMain_item_children_item {
  height: 2.375rem;
  line-height: 2.375rem;
  background: #FFFFFF;
  border-radius: 0.375rem;
  padding: 0 0.9375rem;
  background: #FFFFFF;
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
  margin-right: 0.625rem;
  font-size: 0.94rem;
  font-family: PingFang SC;
  font-weight: 500;
  color: #3F4551;

}
</style>
